<%
String username = (String) session.getValue("username");
String realpath=request.getSession().getServletContext().getRealPath("/");
%>
<%! public static String IMAGE_ICON ="";
	public static String IMAGE_LOGO = "";
	public static String BASE_RING = "";
	public static String ZH = "gb2312";
	public static String EN = "gb2312";
	public static String REQ_EN = "";
	public static String HOME_XML = "";
	public static String HOME_JSP = "";
	public static String BUSI_JSP = "";
	public static String HOME_CSS = "";
	public static String BASE_VIDEO = "";
	public static String BASE_IMAGE = "";
	public static String BASE_TEXT = "";
	public static String HOST_NAME = "";
	public static String BASE_THEME = "";
	public static String BASE_OTHER = "";
	public static String BASE_KJAVA = "";
	public static String XML_PATH = "";
	public static String Item_Path = "";
	public static String BASE_CSS = "";
	public static String BASE_INTRO = "";
	public static String HOST_IP = "";
    public static String HOST_PORT="";
	public String getRealPath(String realpath, String filepath) {
		if (realpath == null || "".equals(realpath))
			return "";
		if (filepath == null || "".equals(filepath))
			return "";
		return realpath.replaceAll("\\", "/") + filepath;
	}

	public String getPathFromProperties(String realpath, String filename,
			String itemname) {
		if (filename == null || "".equals(filename))
			filename = "config.properties";
		if (realpath != null && !"".equals(realpath))
		    filename=realpath+"/WEB-INF/"+filename;
		com.tool.PropertiesUtil properties = new com.tool.PropertiesUtil(filename);
		String itemvalue = properties.getItemValue(itemname);
		if(itemvalue.indexOf(":/")==-1&&itemname.indexOf("HOST")==-1)
		    return realpath.replace("\\","/")+itemvalue;
		else
		  return itemvalue;

	}

	public String getGB2312(String s) {
		if (s != null && !"".equals(s)) {
			try {
				s = new String(s.getBytes("8859_1"), "gb2312");
				return s;
			} catch (Exception ex) {
				System.out.print(ex.getMessage());
			}
		}
		return "";
	}

	public String getGB(String s) {
		if (s != null && !"".equals(s))
			return s;
		return "";
	}%>
	<%
	  IMAGE_ICON=getPathFromProperties(realpath,"","IMAGE_ICON");
	  IMAGE_LOGO=getPathFromProperties(realpath,"","IMAGE_LOGO");
	  BASE_RING=getPathFromProperties(realpath,"","BASE_RING");
	  HOME_XML=getPathFromProperties(realpath,"","HOME_XML");
	  HOME_JSP = getPathFromProperties(realpath,"","HOME_JSP");
	  BUSI_JSP = getPathFromProperties(realpath,"","BUSI_JSP");
	  HOME_CSS = getPathFromProperties(realpath,"","HOME_CSS");
	  BASE_VIDEO = getPathFromProperties(realpath,"","BASE_VIDEO");
	  BASE_IMAGE =getPathFromProperties(realpath,"","BASE_IMAGE");
	  BASE_TEXT = getPathFromProperties(realpath,"","BASE_TEXT");
	  HOST_NAME = getPathFromProperties(realpath,"","HOST_NAME");
	  BASE_THEME =getPathFromProperties(realpath,"","BASE_THEME");
	  BASE_OTHER = getPathFromProperties(realpath,"","BASE_OTHER");
	  BASE_KJAVA = getPathFromProperties(realpath,"","BASE_KJAVA");
	  XML_PATH = getPathFromProperties(realpath,"","XML_PATH");
	  Item_Path = getPathFromProperties(realpath,"","Item_Path");
	  if(Item_Path==null||"".equals(Item_Path))
	    Item_Path=realpath;
	  BASE_CSS =getPathFromProperties(realpath,"","BASE_CSS");
	  BASE_INTRO = getPathFromProperties(realpath,"","BASE_INTRO");
	  HOST_PORT=getPathFromProperties(realpath,"","HOST_PORT");
	 %>
